<?php
App::uses('AppController', 'Controller');
App::uses('CakeEmail', 'Network/Email');
class ContactController extends AppController {
	public $uses = array('Contact');
	public $helpers = array ('Html', 'Form');
	public $components = array('Session');

	public function index(){
		if ($this->request->is('post')) {
			$params = $this->request->data;
			$this->Contact->set($params);
			$params['Contact']['create_time'] = time();

			if ($this->Contact->valid() == true) {
				if ($this->Contact->save($params)) {

					$this->redirect('/');
				}
			} else {
				$this->Session->setFlash("Data is not avaliable !");
			}
		}
	}

}